<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<title>新建机会</title>
	<style type="text/css">
		body{
			margin-top:70px;
		}
		.container-fluid{
			line-height:16px;
		}
		#upcoming_tasks{
			background-color:#fff;
		}
		
	</style>

</head>

<body>
	<%@ include file="include/base.jsp" %>
	<%@ include file="include/base-top.jsp" %>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span8" style="margin-top:60px;">
				<div class="well screen">
					<div class="page-header header">
						<img src="image/mei.png" alt="" />
						<span style="font-size:16px;font-weight:bold;line-height:16px;">添加机会</span>
					</div>
					<div id="parties_loading"  class="live_search_spinner">
						 <div class="liner">
						</div>
					</div>
					<div id="main" class="main">
						<div id="task_filter">
						</div>
					<div id="upcoming_tasks">
					<div id="screen_body">
						<form action="savechance.jspx?contactid=${contact.id}&&chanceItemid=${chanceItem.id}&&employeeid=${employee.id}" method="post">
							 		<br/><br/>
									<div id="aa">
									  	<div class="controls">
									 		<label>联系人</label>
		              						<select id="select01" name="contactname">
		                  					<c:forEach items="${contactList}" var="ch" >
		                  						<option  value="${ch.contactname}" > ${ch.contactname} </option>
		                  					</c:forEach>
		              						</select>
	              						</div>
									<p>*机会名称</p>
									<input type="text" name="chance.chancename"/><br/>
									<p></p>
									 <div class="control-group">
										<label class="control-label" for="textarea">机会描述或背景信息:</label>
										<div class="controls">
											<textarea class="input-xlarge" id="textarea" rows="3" name="chance.des"></textarea>
										</div>
									</div>
									<p>金额：</p>
									<input class="span2" id="chance_price" name="chance.money" type="text"><span style="border:1px #ccc solid;font-size:20px;background-color:#ccc;">元</span>
									<select id="price_type_pulldown" class="span2" name="type_pulldown" onchange="Deals.selectBidType(this)">
										<option value="fixed" selected="selected" id="00">固定价</option>
											<option value="hour" id="11">每小时</option>
											<option value="month" id="2">每月</option>
											<option value="year" id="">每年</option>
									</select>
										<span id="special_bid" style="display: none; ">
											共
										<input type="text"id="date" class="span2" id="span2" />
											
												<span id="hour1">小时</span>
												<span id="month1">月</span>
												<span id="year1">年</span>
										</span>
										<div class="controls">
									 		<label>分类：</label>
		              						<select class="span2" id="select1" name="chanceItemchancename">
		              						<option>无</option>
		                  					<c:forEach items="${chanceItemList}" var="ce" >
		                  						<option  value="${ce.chancename}" > ${ce.chancename} </option>
		                  					</c:forEach>
		                  					<option value="newvalue">新建分类</option>
		              						</select><a href="chanceItem.jspx">编辑分类</a><br/><br/>
	              						</div>
										<div class="controls">
									 		<label>谁负责？</label>
		              						<select id="select01" name="employeename" class="span2">
		                  						<option>无</option>
		                  						<c:forEach items="${employeeList}" var="em" >
		                  							<option  value="${em.id}" > ${em.name} </option>
		                  						</c:forEach>
		              						</select>
	              						</div>
									<br/><br/>	
									<p>谁可以看见这个机会？</p>
									<label class="radio">
										<input type="radio" name="optionsRadios" id="optionsRadios1" value="option1">
											仅自己可见
									</label>
									<label class="radio">
										<input type="radio" name="optionsRadios" id="optionsRadios2" value="option2">
										所有同事都可见
									</label>
									<label class="radio">
										<input type="radio" name="optionsRadios" id="optionsRadios3" value="option3">
										选择同事
									</label>	
										<div id="tongshi" value="tongshi1">
											<select  class="span2" onchange="Deals.selectBidType(this)" id="see" name="employeename1">	
												<option value="tong">选择一个同事...</option>
												<c:forEach items="${employeeList}" var="em" >
		                  							<option  value="${em.id}" id="san"> ${em.name} </option>
		                  						</c:forEach>
											</select>
											<a href="javascript:void(0)"  value="wen1"><img src="image/jian.png" alt="删除同事" id="wen1"/></a>
												<a href="javascript:void(0)"  value="wen2"><img src="image/jia.png" alt="添加同事" id="wen2"/></a>
												<div id="shi" value="">
													<select  class="span2" onchange="Deals.selectBidType(this)" name="employeename2">	
														<option value="tong0">添加同事...</option>
														<c:forEach items="${employeeList}" var="em" >
		                  									<option  value="${em.name}" > ${em.name} </option>
		                  								</c:forEach>
													</select>
												</div>
										</div>
									 
								</div>
								<div class="form-actions">
									<button type="submit" class="btn btn-primary">添加这个机会</button>
									<button type="btn"><a href="chance.jspx">取消</a></button>
								</div>
							 </form>
				
						<div class="tasks tomorrow">

						</div>
					</div>
				</div>
				</div>	
			</div>

			</div>
				<div class="span4 sidebar">
					<div class="well" style="margin-top:60px;">
						<div class="title"><h3>什么是机会？</h3></div>
							<hr/>
							<p>机会即业务机会或商业机会，比如一笔可能成交的业务或项目。<br/>
								机会通常跟一个联系人相关，您需要先将这个联系人添加到系<br/>统。<br/>在输入联系人时，系统会根据已输入的内容自动查找联系人，并<br/>以下拉列表的形式显示出来，您可以从中选取一个。<br/>
								您可以根据自己的业务情况给机会添加分类。<br/>比如按产品分类、按重要程度或行业分类。<br/>
							</p>
					</div>
				</div>
			</div>
		</div>
			<script type="text/javascript">				
				$("#tongshi").attr("style","display:none;");
				$("#wen1").attr("style","display:none;");
				$("#wen2").attr("style","display:none;");
				$("#shi").attr("style","display:none;");
				$("#optionsRadios3").change(function(){
					$("#tongshi").attr("style","display:inline;");
					
				});
				$("#see").change(function(){
					$("#wen1").attr("style","display:inline;");
					$("#wen2").attr("style","display:inline;");	
				});
				$("#wen1").click(function(){
					$("#wen1").attr("style","display:none;");
					$("#wen2").attr("style","display:none;");
				});
				$("#wen2").click(function(){
					$("#shi").attr("style","display:block;");
				});
				$("#select1").change(function(){
					if($("#select1").val()=="newvalue"){
						var va=prompt("请输入类名：");
						$("<option>").html(va).appendTo($("#select1"));
					}
				});
				
				document.getElementById("price_type_pulldown").onchange = function(){
					if($("#price_type_pulldown").val()=="fixed"){
						$("#special_bid").attr("style","display:none;");
					}
					if($("#price_type_pulldown").val()=="hour"){
						$("#special_bid").attr("style","display:inline;");
						$("#hour1").attr("style","display:inline;");
						$("#month1").attr("style","display:none;");
						$("#year1").attr("style","display:none;");
					}
					if($("#price_type_pulldown").val()=="year"){
						$("#special_bid").attr("style","display:inline;");
						$("#hour1").attr("style","display:none;");
						$("#month1").attr("style","display:none;");
						$("#year1").attr("style","display:inline;");
					}
					if($("#price_type_pulldown").val()=="month"){
						$("#special_bid").attr("style","display:inline;");
						$("#hour1").attr("style","display:none;");
						$("#month1").attr("style","display:inline;");
						$("#year1").attr("style","display:none;");
					}
					
				}
			</script>	
		</body>

</html>
